# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Padraic Fanning <fanninpm AT miamioh DOT edu>

pkgname=python-exceptiongroup
_pyname=${pkgname#python-}
pkgver=1.1.1
pkgrel=2
pkgdesc='Backport of PEP 654 (exception groups)'
arch=(any)
url="https://github.com/agronholm/$_pyname"
license=(MIT)
depends=(python)
makedepends=(python-{build,installer,wheel}
             python-flit-scm)
checkdepends=(python-pytest)
_archive="$_pyname-$pkgver"
source=("$url/archive/$pkgver/$_archive.tar.gz")
sha256sums=('abe42a62bac0948d95bba6a48f63d8ebb21a7420fd26039a4ec951873fafaee7')

build() {
	cd "$_archive"
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	python -m build -wn
}

check() {
	cd "$_archive"
	PYTHONPATH=src pytest
}

package() {
	cd "$_archive"
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	python -m installer -d "$pkgdir" dist/*.whl
	install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
}
